package com.holly.unit.system.modular.resource.controller;

import com.holly.unit.scanner.api.ResourceReportApi;
import com.holly.unit.scanner.api.annotation.ApiResource;
import com.holly.unit.scanner.api.annotation.PostResource;
import com.holly.unit.scanner.api.pojo.resource.ReportResourceParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 微服务汇报资源接口
 *
 * @author holly
 * @date 2021/9/25 17:55
 */
@RestController
@ApiResource(name = "微服务汇报资源接口")
@Api(tags = "微服务汇报资源接口")
public class ResourceReportController {

    @Resource
    private ResourceReportApi resourceReportApi;

    /**
     * 接收远程服务资源
     *
     * @author holly
     * @date 2021/9/25 17:55
     */
    @ApiOperation(value = "汇报资源" ,notes = "汇报资源")
    @PostResource(name = "汇报资源", path = "/resourceService/reportResources")
    public void reportResources(@RequestBody ReportResourceParam reportResourceReq) {
        resourceReportApi.reportResources(reportResourceReq);
    }

}
